# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=powertop
pkgver=2.15
pkgrel=5
pkgdesc="Power consumption monitor"
url="https://github.com/fenrus75/powertop"
arch="all"
license="GPL-2.0-only"
makedepends="
	autoconf
	autoconf-archive
	automake
	gettext-dev
	libnl3-dev
	libtool
	linux-headers
	ncurses-dev
	pciutils-dev
	xz
	zlib-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	"
source="$pkgname-$pkgver-2.tar.gz::https://github.com/fenrus75/powertop/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # no tests

prepare() {
	default_prepare
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	LIBS="-lintl" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-nls
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
de4ca3ea25697d2cd5f05c41c82c326ad3e2d21cbf38ddb9b3af40c0d862a70781ca45d9ef7b735ad6def0cb580e4fa153eb4a6e6598e204fc931b30d85ecf41  powertop-2.15-2.tar.gz
"
